<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.yaodian100.core.common.utils.ServerValue"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ include file="/taglibs.jsp"%>
 <script src="/js/jquery.MultiFile.js" type="text/javascript" language="javascript"></script>  
 <script language="javascript">
	$().ready(function(){
		$("#mainSubmit").click(function(){
			if ( "" == $("#imgFiles").val() &&  "" == $("#file-upload").val()){
				alert("请输入批次编号！");
				return false;
			}else if ( "" == $("#file-upload").val()){
				alert("请選擇图档！");
				return false;
			
			}else	 return true;
		});		
	});
</script>	
<s:actionerror />
<h1>供应商提报－商品图档上传<br/>
<div class="f-link"><a href="<%=ServerValue.getMidContextPath()%>/proposeProduct/start.do">回商品提報页</a></div>
</h1>

<table class="tb-data" width="100%">
    	<tr><th>圖&nbsp;&nbsp;&nbsp;片&nbsp;&nbsp;&nbsp;档</th></tr>
<tr>
      <td>  
    	<s:form action ="processUploadImg.do" method ="post" enctype ="multipart/form-data"  class="P10">
	    	${prpsPrdctBatchId}
	    	<c:if test="${empty prpsPrdctBatchId}">
	    	请输入批次编号：<input type="text" name="enterPrdctBatchId" value="" size="25" id="imgFiles"/>       
	        </c:if>
	        <br/><br/>
	        图档或ZIP档上传:
	        <input type="file" name="upload" accept="gif|jpg|zip" class="multi {accept:'gif|jpg|zip', STRING:{ remove:'Remover',  selected:'Selecionado: $file', denied:'Invalido arquivo de tipo $ext!', duplicate:'Arquivo ja selecionado:\n$file!'}}" id="file-upload" size="50"/>
	        <br/>
	        <input type="hidden" name="prpsPrdctBatchId" value="${prpsPrdctBatchId}"/>
	        <s:submit value="上传圖片档" id="mainSubmit"/>       
    	</s:form>     	    
      </td>        
</tr>
</table>
 <table class="tb-1" width="100%">		
		<tbody>
			 <c:forEach items="${proposeProducts}" var="product" varStatus="rows_index">
			 
			 <tr>				
				<th>商品名称</th>				
			</tr>
			<tr class="${rows_index.count % 2 == 0 ? 'bg-yl' : ''}">					
					<td>${product.name}</td>
				</tr>
				<tr class="${rows_index.count % 2 == 0 ? 'bg-yl' : ''}">					
					<td>
					<img src="/PImg/${fn:substring(product.id,0,4)}/${product.id}/${product.id}_m75.jpg"  onError="this.src='/PImg/blank_75.gif'" width="75" height="75" />
				</tr>
			
			</c:forEach>
		</tbody>
	</table>